Skip to content

fix: drop bogus Incidents.delete + add StatusPages.reorder_layout#6

Merged
caballeto merged 1 commit into
mainfrom
fix/incidents-cleanup-and-reorder-layout
Apr 22, 2026
Merged

fix: drop bogus Incidents.delete + add StatusPages.reorder_layout#6
caballeto merged 1 commit into
mainfrom
fix/incidents-cleanup-and-reorder-layout

Conversation

@caballeto
Copy link
Copy Markdown
Member

Summary

Fixes two surface-parity gaps surfaced by the monorepo's tests/surfaces/parity/ suite.

1. Drop Incidents.delete() — endpoint never existed

The underlying API endpoint DELETE /api/v1/incidents/{id} is not implemented on the API server. Calling client.incidents.delete(id) would always return a 404 — the method has never produced a successful response. It was a leftover from earlier API experimentation.

All other surfaces (sdk-js, mcp-server, cli, terraform-provider) correctly omit it, so the parity check (rightly) flagged sdk-python as out of sync.

Decision: remove from sdk-python rather than implement the endpoint. Incidents are auto-resolved by the pipeline or manually resolved via incidents.resolve(...). Permanent deletion is not part of the product surface.

This is technically a breaking change to the public API, but with no real consumers it's safe to ship as a 0.x patch (captured in the next release version bump).

2. Add StatusPages.reorder_layout(id, body)

The API endpoint PUT /api/v1/status-pages/{id}/layout/reorder exists and sdk-js already exposes statusPages.reorderLayout(...). sdk-python was missing the method, creating a real parity gap.

This PR:

  • Adds reorder_layout(id, body: RequestBody[ReorderPageLayoutRequest]) -> None to the StatusPages root class.
  • Re-exports ReorderPageLayoutRequest from devhelm and devhelm.types.
  • Adds a status-pages.reorder-layout op to the surface-test harness (tests/run_sdk.py).
  • Bumps uv.lock to track the published devhelm 0.2.0.

Test plan

  • pytest tests/ — 707 passed
  • mypy src/ — clean (23 files)
  • ruff format --check / ruff check — clean
  • make test-surface SURFACE=sdk_python against test API — 174 passed, 1 skipped
  • After merge: cut devhelm 0.2.1 release; once on PyPI, sister PR on mcp-server bumps the pin and adds the reorder_status_page_layout tool.

Companion PRs

  • mono#260 — fixes 3 stale parity-test issues (introspect override anticipates the new reorder_status_page_layout MCP tool).
  • mcp-server — coming once devhelm 0.2.1 is on PyPI: adds the reorder_status_page_layout MCP tool.

Made with Cursor

Two surface-parity gaps surfaced by `tests/surfaces/parity/`:

1. **Drop `Incidents.delete()`** — the underlying API endpoint
   `DELETE /api/v1/incidents/{id}` does not exist; calling this method
   would always return a 404. The method was a leftover from earlier API
   experimentation and was missing from sdk-js / mcp-server / cli, so the
   parity check (rightly) flagged sdk-python as out of sync. Removing it
   here is the canonical decision: incidents are auto-resolved or manually
   resolved via `incidents.resolve(...)`, never deleted.

   This is technically a breaking change to the `devhelm` Python package
   public API, but no real consumers exist (the method has never produced
   a successful response). Captured in the version bump for the next
   release.

2. **Add `StatusPages.reorder_layout(id, body)`** — hits the existing
   `PUT /api/v1/status-pages/{id}/layout/reorder` endpoint, mirroring
   `sdk-js.StatusPages.reorderLayout`. Wires through the
   `ReorderPageLayoutRequest` model (already in `_generated.py`); also
   re-exports it from the top-level `devhelm` package and `devhelm.types`,
   plus a harness entry for the surface-test suite.

   Synced uv.lock to match `devhelm` 0.2.0 already in pyproject.toml.

Verified locally:
- `pytest tests/` — 707 passed
- `mypy src/` — clean
- `ruff format` / `ruff check` — clean
- `make test-surface SURFACE=sdk_python` (against test API) — 174 passed,
  1 skipped

Made-with: Cursor
@caballeto caballeto merged commit 3bde173 into main Apr 22, 2026
4 checks passed
@caballeto caballeto deleted the fix/incidents-cleanup-and-reorder-layout branch April 22, 2026 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant